/* eslint no-undef: 0 */
/* eslint arrow-parens: 0 */
import React from 'react';
import { enquireScreen } from 'enquire-js';

import Banner1 from '../../components/portal/Banner1';
import Content4 from '../../components/portal/Content4';
import Feature3 from '../../components/portal/Feature3';
import Feature0 from '../../components/portal/Feature0';
import Content11 from '../../components/portal/Content11';
import Content12 from '../../components/portal/Content12';

import {
  Banner10DataSource,
  Content40DataSource,
  Feature30DataSource,
  Feature00DataSource,
  Content110DataSource,
  Content120DataSource,
} from '../../components/portal/data.source';

let isMobile;
enquireScreen(b => {
  isMobile = b;
});

export default class Home extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isMobile,
    };
  }

  componentDidMount() {
    // 适配手机屏幕;
    enquireScreen(b => {
      this.setState({ isMobile: !!b });
    });
  }

  render() {
    const children = [
      // 轮播
      <Banner1
        id="Banner1_0"
        key="Banner1_0"
        dataSource={Banner10DataSource}
        isMobile={this.state.isMobile}
      />,
      // 视频
      <Content4
        id="Content4_0"
        key="Content4_0"
        dataSource={Content40DataSource}
        isMobile={this.state.isMobile}
      />,
      // 服务
      <Feature3
        id="Feature3_0"
        key="Feature3_0"
        dataSource={Feature30DataSource}
        isMobile={this.state.isMobile}
      />,
      // 软件产品
      <Feature0
        id="Feature0_0"
        key="Feature0_0"
        dataSource={Feature00DataSource}
        isMobile={this.state.isMobile}
      />,
      // 会员服务
      <Content11
        id="Content11_0"
        key="Content11_0"
        dataSource={Content110DataSource}
        isMobile={this.state.isMobile}
      />,
      // 客户案例
      // <Content5
      //  id="Content5_0"
      //  key="Content5_0"
      //  dataSource={Content50DataSource}
      //  isMobile={this.state.isMobile}
      // >,
      // 合作伙伴
      <Content12
        id="Content12_0"
        key="Content12_0"
        dataSource={Content120DataSource}
        isMobile={this.state.isMobile}
      />,
    ];

    return <div>{children}</div>;
  }
}
